package com.java.yz.day14.sleep;

public class MySleepThread extends Thread{
    public MySleepThread() {
    }

    public MySleepThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        System.out.println(getName()+"我要开始睡觉了");
        try {
            Thread.sleep(5000); //里面传入的是毫秒级别
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(getName()+"我醒了");
    }
}
